<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<title>作品管理</title>
</head>



<%

	String base_path = request.getScheme()
		+ "://"
		+ request.getServerName()
		+ ":"
		+ request.getServerPort()
		+ request.getContextPath();
	
%>


<%@ page import="data.User" %>
<%@ page import="data.Author" %>
<%

	boolean state_login = false;
	boolean is_author = false;
	
	Integer user_id = (Integer)session.getAttribute(User.Attribute.ID.getFullName());
	String username = (String)session.getAttribute(User.Attribute.USERNAME.getFullName());
	String password = (String)session.getAttribute(User.Attribute.PASSWORD.getFullName());
	
	if (username != null && password != null)
		if (User.checkUser(username, password))
			state_login = true;
	
	if (user_id != null)
		if (Author.hasAuthor(user_id))
			is_author = true;
%>


<script>

	if (<%=state_login%> == false)
	{
		alert("请先登录账号");
		window.location.href = "../index.jsp";
	}
	
	if (<%=state_login%> && <%=is_author%> == false)
	{
		alert("你还未注册成为作者");
		window.location.href = "../index.jsp";
	}

</script>


<body>

	
	<nav class="bar_top">
		<a class="bar_item bar_home" href="./works_manage.jsp">公告</a>
		<a class="bar_item bar_works_manage" href="#navid-book_manage">
		作品管理
		</a>
		<a class="bar_item bar_comments" href="#navid-review_manage">
		读者评论
		</a>
		<a class="bar_item bar_author" href="./myself_author.jsp">作者信息</a>
		<a class="bar_item bar_back" href="../index.jsp">回到首页</a>
	</nav>
	


	<div class="list_works">
		<a href="#list_works_articles">文章</a>
		<a href="#list_works_books">书</a>
		
		<div class="panel panel-primary">
		
			<div class="panel-heading">
				
	    	</div>
	    	
			<div class="panel-body" id="list_works_articles">
				a
			</div>
			
			<ul class="list-group">
		        <li class="list-group-item">免费域名注册</li>
		        <li class="list-group-item">免费 Window 空间托管</li>
		        <li class="list-group-item">图像的数量</li>
		        <li class="list-group-item">24*7 支持</li>
		        <li class="list-group-item">每年更新成本</li>
		    </ul>
		</div>
		
		<div class="panel panel-primary">
		
			<div class="panel-heading">
				
	    	</div>
	    	
			<div class="panel-body" id="list_works_books">
				b
			</div>
			
			<ul class="list-group">
		        <li class="list-group-item">免费域名注册</li>
		        <li class="list-group-item">免费 Window 空间托管</li>
		        <li class="list-group-item">图像的数量</li>
		        <li class="list-group-item">24*7 支持</li>
		        <li class="list-group-item">每年更新成本</li>
		    </ul>
		</div>
		
		
		
		
	</div>

</body>


<style>

	html {
	    background-attachment: fixed
	}
	
	img { border: 0 none; vertical-align: baseline; }

	.bar_top .bar_item {
		margin: 5px;
	}
	
	
	.bar_top {
		display:flex;
	}
	
	.bar_top .active { color: #000; font-weight: bold; background-color: #fff7e8; }
	
	.bar_top .bar_home:before { background-position: 0px 4px; }
	.bar_top .active.bar_home:before { background-position: 0px -44px; }
	
	.bar_top .bar_works_manage:before { background-position: -48px 4px; }
	.bar_top .active.bar_works_manage:before { background-position: -48px -44px; }
	
	.bar_top .bar_comments:before { background-position: -96px 4px; }
	.bar_top .active.bar_comments:before { background-position: -96px -44px; }
	
	.bar_top .bar_author:before { background-position: -192px 4px; }
	.bar_top .active.bar_author:before { background-position: -192px -44px; }
	
	.bar_top .bar_quit { display: inline-block; margin-right: 5px; vertical-align: sub; }
	
	.bar_top .bar_quit:before { width: 16px; height: 16px; margin: 0; background-position: -16px -148px; }
	
	.list_group_item.active a { color: #60b24e; }
	
	.bar_top .user_info { float: right; width: 27%; max-width: 27%; margin: 52px 10px 0 0; text-align: right; }
	
</style>



</html>



